﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MainForm.Master" EnableEventValidation="false" AutoEventWireup="true" CodeBehind="MyWorkitem.aspx.cs" Inherits="WF.Web.Pages.WorkSpace.MyWorkitem" %>

<%@ MasterType VirtualPath="~/MainForm.Master" %>
<%@ Register Src="../UserControl/UCPager.ascx" TagName="UCPager" TagPrefix="uc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="Title" runat="server">
    我的待办事项
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Other_head" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="Path" runat="server">
    <asp:Label ID="lblPath" runat="server">我的工作台 > 待办事项</asp:Label>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="Main" runat="server">
    <asp:ScriptManagerProxy ID="ScriptManagerProxy1" runat="server">
        <Scripts>
            <asp:ScriptReference Path="~/Scripts/ui/jquery.ui.core.js" />
            <asp:ScriptReference Path="~/Scripts/ui/jquery.ui.widget.js" />
            <asp:ScriptReference Path="~/Scripts/ui/jquery.ui.tabs.js" />
            <asp:ScriptReference Path="~/Scripts/DatePicker/WdatePicker.js" />
        </Scripts>
    </asp:ScriptManagerProxy>
    <div class="inputform">
        <table>
            <tr>
                <th>流程类型
                </th>
                <td>
                    <asp:DropDownList ID="lstApplyType" runat="server" DataSourceID="odsApplyType"
                        DataTextField="ApplyType" DataValueField="ApplyType"
                        OnDataBound="lstApplyType_DataBound">
                        <asp:ListItem Value="" Selected="True" Text="--All--"></asp:ListItem>
                    </asp:DropDownList>
                </td>
                <th>申请日期
                </th>
                <td>
                    <asp:TextBox ID="txtStartDate" runat="server" Width="85px"
                        MaxLength="10" CssClass="inputdates" onfocus="WdatePicker({skin:'default'})"></asp:TextBox>

                    &nbsp;-&nbsp;<asp:TextBox ID="txtEndDate" runat="server" Width="85px"
                        MaxLength="10" CssClass="inputdates" onfocus="WdatePicker({skin:'default'})"></asp:TextBox>

                </td>
                <% if (_vFlag) %>
                <% { %>
                <th><b>审批人账号       </b>    
                </th>
                <td>
                    <asp:TextBox ID="txtApprover" runat="server" Width="100px" CssClass="inputs"></asp:TextBox>
                </td>
                <% } else { %>
                <td></td>
                <td></td>
                <% } %>
            </tr>
            <tr>
                <th>事项类型</th>
                <td>
                    <asp:RadioButtonList ID="rblType" runat="server" RepeatDirection="Horizontal">
                        <asp:ListItem Value="0" Selected="True">全部</asp:ListItem>
                        <asp:ListItem Value="1">非委托</asp:ListItem>
                        <asp:ListItem Value="2">委托</asp:ListItem>
                    </asp:RadioButtonList></td>
                <th>流程名称</th>
                <td>
                    <asp:TextBox ID="txtPropertyName" runat="server" CssClass="textfield1"></asp:TextBox>
                </td>
                <td colspan="2">
                    <asp:Button ID="btnSearch" runat="server" CssClass="inputbtn" Text="查询" OnClick="btnSearch_Click" />
                    <asp:Button ID="btnClear" runat="server" CssClass="inputbtn" Text="重置" OnClientClick="reset();" />
                </td>
            </tr>
        </table>
    </div>
    <div class="ititle">
        <h4>我的待办事项列表<asp:Label ID="lblCount" runat="server" Text="" ForeColor="red"></asp:Label></h4>
    </div>
    <div class="dataGrid">
        <asp:ListView ID="dataListView" runat="server" DataSourceID="" DataKeyNames="WorkListID,ProcInstID,URL,SN,Status"
            EnableModelValidation="true">
            <LayoutTemplate>
                <table cellspacing="0" class="Grid">
                    <tr>
                        <th width="12%">流程类型
                        </th>
                        <th width="10%">申请时间
                        </th>
                        <th width="38%">申请名称
                        </th>
                        <th width="8%">当前步骤
                        </th>
                        <th width="12%">当前审批者

                        </th>
                        <th width="5%">处理
                        </th>
                        <th width="5%">流程图

                        </th>
                        <th width="5%">释放
                        </th>
                    </tr>
                    <asp:PlaceHolder ID="itemPlaceHolder" runat="server" />
                </table>
            </LayoutTemplate>
            <ItemTemplate>
                <tr>
                    <td>
                        <%# Eval("ProcessName")%>
                    </td>
                    <td>
                        <%# Eval("StartDate","{0:yyyy-MM-dd hh:mm:ss}")%>&nbsp;
                    </td>
                    <td>
                        <%# Eval("Folio")%>&nbsp;
                    </td>
                    <td>
                        <%# Eval("CurActivityName")%>&nbsp;
                    </td>
                    <td>
                        <%# Eval("OpenBy")%>&nbsp;
                    </td>
                    <td>
                        <asp:Button ID="Button8" runat="server" CssClass="btnAudit" OnClientClick=<%# "return ShowDialog('" + Eval("URL") + "',650,600,'status:Modal;help:no');window.location=window.location;return false;"%> />
                    </td>
                    <td>
                        <asp:Button ID="Button2" runat="server" CssClass="btnViewWFInfo" OnClientClick=<%# "return ShowDialog('../WorkflowInfo/ShowStatusChart.aspx?ProcInstID=" + Eval("ProcInstID") + "',window.screen.width, window.screen.height, 'scroll:no');"%> ToolTip="查看流程信息" />
                    </td>
                    <td>
                        <asp:Button ID="Button4" runat="server" CssClass="btnRelease" OnClientClick=<%# "if(confirm('您确定要释放该事项吗?')) {releaseByWorkItemID('" + Eval("workListID") + "');}"%> />
                    </td>
                </tr>
            </ItemTemplate>
            <EmptyDataTemplate>
                <table id="Table1" runat="server" style="">
                    <tr>
                        <td>您暂时没有待办事项!
                        </td>
                    </tr>
                </table>
            </EmptyDataTemplate>
        </asp:ListView>
        <asp:ObjectDataSource ID="odsApplyType" runat="server" SelectMethod="GetAllEntity"
            TypeName="WF.ViewModels.WF_ApplyTypes.WF_ApplyTypeListVM"></asp:ObjectDataSource>
    </div>
    <script type="text/javascript" language="javascript">
        function OnImageClick(img, trID) {
            var tr = document.getElementById(trID);
            if (img.src.indexOf("minus") > 0) {
                img.src = "../images/plus.gif";
                tr.style.display = "none";
            }
            else {
                img.src = "../images/minus.gif";
                tr.style.display = "";
            }
        }
        function release(K2WorkSpaceURL, SN) {
            var vReturnValue = window.showModalDialog(K2WorkSpaceURL + "/WorkList/AddIn/release.aspx?SN=" + SN, "a", "dialogHeight:0px;dialogWidth:0px;center:yes;help:no;resizable:no;status:no;scroll:no");
            window.parent.location = window.parent.location;
        }

        function releaseByWorkItemID(workItemID) {
            //var vReturnValue = window.showModalDialog("Release.aspx?WorkListItemID=" + workItemID, "Release", "dialogHeight:0px;dialogWidth:0px;center:yes;help:no;resizable:no;status:no;scroll:no");
            var vReturnValue = window.open("Release.aspx?WorkListItemID=" + workItemID, "Release", "dialogHeight:0px;dialogWidth:0px;center:yes;help:no;resizable:no;status:no;scroll:no");
            window.location = window.location;
        }
        function redirect(K2WorkSpaceURL, SN) {
            var vReturnValue = window.showModalDialog(K2WorkSpaceURL + "/AddIn/DialogHost.aspx?scrOpt=no&Title=Redirect Worklist Item&Skin=" + K2WorkSpaceURL + '/stylesheet/mainstyle_olive.css' + "&srcStr=" + K2WorkSpaceURL + "/WorkList/AddIn/RedirectItem.aspx?SN=" + SN + "|Skin=" + 'stylesheet/mainstyle_olive.css', "a", "dialogheight:495px;dialogwidth:620px;center:yes;help:no;resizable:no;status:no;scroll:yes");
            window.parent.location = window.parent.location;
        }
        function closewindow() {
            window.location = window.location
        }
    </script>
</asp:Content>
